// 练习3：定义一个Circle类，可以计算圆的面积和圆的周长。圆的半径通过定义对象时由初始化完成编写
// 相应的调试用函数，来测试该类的正确性

#include <iostream>

using namespace std;

class Circle
{
public:
    Circle();
    Circle(int r = 3);
    Circle(const Circle &ob);
    ~Circle();

public: 
    float area(void);
    float perimeter(void);


private:
    int r;
};

int main(int argc, char **argv)
{
    Circle c(3);

    cout << c.area() << endl;
    cout << c.perimeter() << endl;

    return 0;
}



Circle::Circle()
{
    r = 3;
}
Circle::Circle(int r)
{
    this->r = r;
}
Circle::Circle(const Circle &ob)
{
    this->r = ob.r;
}
Circle::~Circle()
{
    // 析构函数

}

float Circle::area(void)
{
    return r * r * 3.14;
}

float Circle::perimeter(void)
{
    return 2 * 3.14 * r;
}